<style>
    #addUser th {
        text-align: center;
        vertical-align: middle;
        border-right: 1px solid #ededed;
    }
</style>
<div class="box-body table-responsive no-padding" id="addUser" ms-controller="addUser">
    <table class="table table-hover">
        <tbody>
        <tr>
        <tr>
            <th>用户名</th>
            <td><input type="text" class="form-control" ms-duplex="user.name"/></td>
        </tr>
        <th>密码</th>
        <td><input type="text" class="form-control" ms-duplex="user.passWord"/></td>
        </tr>
        <th>角色</th>
        <td>
            <label class="radio-inline">
                <input type="radio" name="roleLable" ms-duplex-string="user.roleId" value="1">管理员
            </label>
            <label class="radio-inline">
                <input type="radio" name="roleLable" ms-duplex-string="user.roleId" value="2">分析师
            </label>
            <label class="radio-inline">
                <input type="radio" name="roleLable" ms-duplex-string="user.roleId" value="3">合作伙伴
            </label>
        </td>
        </tr>
        <th>状态</th>
        <td>
            <label class="radio-inline">
                <input type="radio" name="stateLable" ms-duplex-string="user.state" value="1">正常
            </label>
            <label class="radio-inline">
                <input type="radio" name="stateLable" ms-duplex-string="user.state" value="0">禁用
            </label>
        </td>
        </tr>
        <th>性别</th>
        <td>
            <label class="radio-inline">
                <input type="radio" name="sexLable" ms-duplex-string="user.sex" value="1">男
            </label>
            <label class="radio-inline">
                <input type="radio" name="sexLable" ms-duplex-string="user.sex" value="0">女
            </label>
        </td>
        </tr>
        <th>邮箱</th>
        <td><input type="text" class="form-control" ms-duplex="user.email"/></td>
        </tr>
        <th>手机号码</th>
        <td><input type="text" class="form-control" ms-duplex="user.phone"/></td>
        </tr>
        </tbody>
    </table>
</div>
<script>
    $(function () {
        avalon.ready(function () {
            var addUserVm = avalon.define({
                $id: "addUser",
                user: {'name': '', 'passWord': '', 'sex': '', 'state': '', 'roleId': '', 'email': '', 'phone': ''},
                init: function () {
                    user = addUserVm.user;
                }
            })
            avalon.scan($('#addUser')[0], addUserVm);
            addUserVm.init();
        })
    });

</script>
